<?php

namespace Yousheng\DatabaseToolbox\Console;

use Illuminate\Console\Command;
use Yousheng\DatabaseToolbox\Json2Migration\JsonToMigration;

class Json2Migrations extends Command
{
    protected $signature = 'youshengdb:migration {file}';
    protected $description = "基于json或json5文件生数据迁移文件.";

    public function handle():void
    {
        $this->info("开始创建迁移文件...");
        if (!$this->argument('file')) {
            $this->error('请输入json文件名');
            return;
        }
        new JsonToMigration($this->argument('file'));
        $this->info("迁移文件创建成功!");
    }

}